import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt(); // 读取字符串长度
        String s = scanner.next(); // 读取字符串
        scanner.close();

        int maxVowelPalindromeLength = 0;

        // 遍历字符串，寻找最长的元音回文子串
        for (int i = 0; i < n; i++) {
            // 检查以当前字符为中心的奇数长度的回文子串
            for (int j = 1; i + j <= n; j += 2) {
                if (isVowelPalindrome(s, i, i + j)) {
                    maxVowelPalindromeLength = Math.max(maxVowelPalindromeLength, j);
                }
            }
            // 检查以当前字符和下一个字符为中心的偶数长度的回文子串
            for (int j = 1; i + j < n; j++) {
                int k = j - 1;
                if (isVowelPalindrome(s, i, i + j + 1)) {
                    maxVowelPalindromeLength = Math.max(maxVowelPalindromeLength, j + 1);
                }
            }
        }

        System.out.println(maxVowelPalindromeLength);
    }

    // 检查子串是否为元音回文子串
    private static boolean isVowelPalindrome(String s, int start, int end) {
        while (start < end) {
            if (!isVowel(s.charAt(start)) || !isVowel(s.charAt(end))) {
                return false;
            }
            start++;
            end--;
        }
        return true;
    }

    // 检查字符是否为元音
    private static boolean isVowel(char c) {
        return "aeiou".indexOf(c) != -1;
    }
}
